package asava.names;

/**
 * @author Tim Richter
 */
public final class Name {
    public final NameTable table;
    public final String value;

    public Name(final NameTable table,
                final String value) {
        this.table = table;
        this.value = value;
    }

    public Name prepend(final String value) {
        return table.enter(value + this.value);
    }

    public Name append(final String value) {
        return table.enter(this.value + value);
    }

    @Override
    public String toString() {
        return value;
    }
}
